package com.ra.landlord;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.ra.system.Version;

/**
 * 工作日志
 * 
 * @author Jerry
 *
 */
@Entity
@Table(name = "ra_worklog")
public class WorkLog implements Version, LandlordOwner {

	private Integer id;
	
	// TODO: 比方 0  - 维修事件， 1 - 
	// 如为自定义事件， 参照见 type_specification
	private Integer type;
	
	// 0 - 固定事件， 1 - 自定义事件
	private Integer exType;
	
	// 是否提醒
	private Boolean remind;
	
	private Date remindTime;
	
	private Date createTime;
	
	// TODO: 0 - 不处理， 1 - 处理中， 2 - 已处理， 3 - 未处理
	// worklog_Type_Handle
	private Integer handleType;
	
	private LandlordOwnerUser landlordUser;
	
	private LandlordUser agent;
	
	private String title;
	
	private String content;
	
	private Integer version;
	
	private Integer status;

	@Id
	@GeneratedValue
	@Column(name = "worklog_id")
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "worklog_type")
	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	@Column(name = "worklog_type_ex")
	public Integer getExType() {
		return exType;
	}

	public void setExType(Integer exType) {
		this.exType = exType;
	}

	@Column(name = "worklog_IsRemind")
	public Boolean getRemind() {
		return remind;
	}

	public void setRemind(Boolean remind) {
		this.remind = remind;
	}

	@Column(name = "worklog_RemindTime")
	public Date getRemindTime() {
		return remindTime;
	}

	public void setRemindTime(Date remindTime) {
		this.remindTime = remindTime;
	}
	
	@Column(name = "worklog_time")
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Column(name = "worklog_Type_Handle")
	public Integer getHandleType() {
		return handleType;
	}

	public void setHandleType(Integer handleType) {
		this.handleType = handleType;
	}

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name = "createuserid")
	public LandlordOwnerUser getLandlordUser() {
		return landlordUser;
	}

	public void setLandlordUser(LandlordOwnerUser landlordUser) {
		this.landlordUser = landlordUser;
	}

	@Column(name = "worklog_title")
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "worklog_content")
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name = "administrator_id")
	public LandlordUser getAgent() {
		return agent;
	}

	public void setAgent(LandlordUser agent) {
		this.agent = agent;
	}

	@Column(name = "version_id")
	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

	@Column(name = "data_status")
	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}
	
}
